Computing Abelian Periods in Words
نویسندگان
چکیده
In the last couple of years many works have been devoted to Abelian complexity of words. Recently, Constantinescu and Ilie (Bulletin EATCS 89, 167–170, 2006) introduced the notion of Abelian period. We show that a word w of length n over an alphabet of size σ can have Θ(n2) distinct Abelian periods. However, to the best of our knowledge, no efficient algorithm is known for computing these periods. The BruteForce algorithm computes all the Abelian periods either in time O(n3 × σ) using O(σ) space or in time O(n2×σ) using O(n×σ) space. We present an off-line algorithm running in time O(n2×σ) using O(n+σ) space, thus improving the space complexity. This algorithm is based on a select function. We then present on-line algorithms that also enable to compute all the Abelian periods of all the prefixes of w. Experimental results show that the new off-line algorithm is faster than the Brute-Force one. Moreover, in most cases, one on-line algorithm, though having a worst case time complexity, is also faster than the Brute-Force one.
منابع مشابه
Quasi-linear Time Computation of the Abelian Periods of a Word
In the last couple of years many research papers have been devoted to Abelian complexity of words. Recently, Constantinescu and Ilie (Bulletin EATCS 89, 167–170, 2006) introduced the notion of Abelian period. In this article we present two quadratic brute force algorithms for computing Abelian periods for special cases and a quasi-linear algorithm for computing all the Abelian periods of a word.
متن کاملAlgorithms for Computing Abelian Periods of Words
Constantinescu and Ilie (Bulletin EATCS 89, 167–170, 2006) introduced the notion of an Abelian period of a word. A word of length n over an alphabet of size σ can have Θ(n2) distinct Abelian periods. The Brute-Force algorithm computes all the Abelian periods of a word in time O(n2× σ) using O(n × σ) space. We present an off-line algorithm based on a select function having the same worst-case th...
متن کاملFast Algorithms for Abelian Periods in Words and Greatest Common Divisor Queries
We present efficient algorithms computing all Abelian periods of two types in a word. Regular Abelian periods are computed in O(n log logn) randomized time which improves over the best previously known algorithm by almost a factor of n. The other algorithm, for full Abelian periods, works in O(n) time. As a tool we develop an O(n) time construction of a data structure that allows O(1) time gcd(...
متن کاملAbelian periods, partial words, and an extension of a theorem of Fine and Wilf
Recently, Constantinescu and Ilie proved a variant of the wellknown periodicity theorem of Fine and Wilf in the case of two relatively prime abelian periods and conjectured a result for the case of two nonrelatively prime abelian periods. In this paper, we answer some open problems they suggested. We show that their conjecture is false but we give bounds, that depend on the two abelian periods,...
متن کاملFine and Wilf’s Theorem for Abelian Periods in Partial Words
Recently, Constantinescu and Ilie proved a variant of the well-known periodicity theorem of Fine and Wilf in the case of two relatively prime abelian periods, and conjectured a result for the case of two non-relatively prime abelian periods. More precisely, they proved that any full word having two coprime abelian periods p, q and length at least 2pq− 1 has also gcd(p, q) = 1 as a period. In th...
متن کامل